package com.ln.demo04;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/10/25 16:05
 */
public class Test04 {
    public static void main(String[] args) {
        Info<String> info = new Info<>();
        info.setVar("你好世界");
        fun2(info);

        Info<Integer> info1 = new Info<>();
        info1.setVar(22);
        fun1(info1);
    }
    //设置对象泛型的上限
    public static void fun1(Info<? extends Number> info){
        info.show();
    }
    //设置对象泛型的下限
    public static void fun2(Info<? super String> info){
        info.show();
    }
}
